package com.yt.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Classname OrderController
 * @Description
 * @Date 2021/10/26 8:13
 * @Create by 杨涛
 */
@RestController
@Slf4j
@RefreshScope
public class OrderController {
    @Value("${service-url}")
    private String serviceUrl;

    @Value("${config.info}")
    private String configinfo;

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("/getport")
    public String getport(){
        log.info("当前配置信息："+configinfo);
        return restTemplate.getForObject(serviceUrl+"/getport",String.class);
    }
}


